/**
 * Created with IntelliJ IDEA
 * Description:用Runnable接口创建线程
 * User:恋恋
 * Date:2023-09-03
 * Time:9:50
 */
class MyRunnable implements Runnable{
    @Override
    public void run() {
        System.out.println("这里是用Runnable接口来创建线程");
    }
}
public class Test2 {
    public static void main(String[] args) {
        //创建Thread实例，调用Thread的构造方法，将Runnabled对象作为target参数
        Thread t = new Thread(new MyRunnable());
        t.start();
    }


}
